<template>
	<view>
		<scroll-view scroll-x class="bg-white nav">
				<view class="main">
					<view class="main-box">
						<form>  
							<view  class="cg-main">
								<view class="sticky"> 
									<view class="cu-form-group" @tap="open('QS_Picekr_date',0)">
										<view class="title">单据日期：　{{timeData.fulldate}}</view>
										<!-- <view @click="open(1)" class="inpt1">
											<input disabled="true">{{timeData.fulldate}}</input>
										</view> -->
									</view>
									<view class="cu-form-group"　@tap="open('QS_Picekr_date',1)">
										<view class="title">结束日期：　{{timeData1.fulldate}}</view>
										<!-- <view @click="open(2)" class="inpt1">
											<input disabled="true">{{timeData1.fulldate}}</input>
										</view> -->
									</view>
									<view class="cu-form-group">
										<view class="title">单据编号：</view>
										<input  placeholder="请输入单据编号"  v-model="BillNo" ></input>
									</view>
									<view class="cu-form-group" @click="clickopen(1,'配出仓库')">
										<view class="title" >配出仓库：</view>
										<input :value="checkedClientList.StoreName" placeholder="点击选择<配出仓库>" disabled="true">
										 <!-- <view class="supplieruser">{{checkedClientList.StoreName}}</view> -->
									</view>
									<view class="cu-form-group" @click="clickopen(2,'配入仓库')">
										<view class="title">配入仓库：</view>
										<input :value="checkedwarehouse.StoreName" disabled="true" placeholder="点击选择<配入仓库>">
										<!-- <view class="supplieruser">{{checkedwarehouse.StoreName}}</view> -->
									</view>
									
									<view class="cu-form-group" @click="clickopen(3,'业务员')">
										<view class="title">业 务 员 ：</view>
										<input disabled="true" placeholder="点击选择<业务员>" :value="checksalesman.OperatorName">
										<!-- <view class="supplieruser">{{checksalesman.OperatorName}}</view> -->
									</view>
									
									<!-- <view class="cu-form-group"> -->
										<!-- <view class="uni-padding-wrap"> -->
										           <!-- <view class="uni-title">默认样式</view> -->
										   <!-- <view> -->
											<!-- <label class="radio"><radio value="r1" @click="ischecka" :checked="ischeckall" />全选</label> -->
											<!-- <radio-group @change="radioChange"> -->
										    <!-- <label class="radio"><radio value="r2"   checked="true"/>在线数据</label> -->
										    <!-- <label class="radio"><radio value="r3"  disabled="true" />离线数据</label> -->
											<!-- </radio-group> -->
										    <!-- </view> -->
										   <!-- </view> -->
									<!-- </view> -->
								</view>
		                        <view>
								</view>

									<view class="cu-form-group" >
										<button class="cu-btn  stop text-white btn_width" @click="SelBill">查询</button>
										<!-- <input class="inpt" name="input" disabled="true"></input> -->
										<!-- <button class="cu-btn  stop text-white btn_width btn_color" @click="addSelectGoods">上传</button> -->
										<button class="cu-btn   text-white btn_width btn_color" @click="DelectGoods">删除</button>
										<button class="cu-btn  stop text-white btn_width" @click="electGoods">选择</button>
										<!-- <button class="cu-btn  stop text-white btn_width" @click="toDetail()">选择</button> -->
										<button class="cu-btn  stop text-white btn_width" @click="selectcheck">全选</button>
										<!-- elect -->
									</view>
									<!-- <view class="cu-form-group">
					
										<button class="cu-btn  stop text-white btn_width" @click="swits()">切换</button>
										
									</view> -->
								<!--商品明细列表-->
							
							</view>
						
						</form>
					</view>
				</view>
				
				<!-- 表格home -->
				<view class="orderList" :style="{height: orderListHeight + 'px'}" v-show="switrs == 1">
					<view class="orderNav" :style="{width:tdAllWidth+'px'}">		
						<text :style="{width:tdWidth[0]+'px'}">序号</text>
						<text :style="{width:tdWidth[1]+'px'}">选择</text>
						<text :style="{width:tdWidth[2]+'px'}">单号</text>
						<text :style="{width:tdWidth[3]+'px'}">日期</text>
						<text :style="{width:tdWidth[4]+'px'}">配出仓库</text>
						<text :style="{width:tdWidth[5]+'px'}">配入仓库</text>
						<text :style="{width:tdWidth[6]+'px'}" >业务员</text>
						<text :style="{width:tdWidth[7]+'px'}" >备注</text>
					</view>
					<view class="orderLi" :style="{height:orderLiHeight +'px',width:tdAllWidth+'px'}">
						<view class="orderItem" v-for="(item,index) in tableList"  
										 :class="[{'background':!(index%2==0)}]"  :key="index" @click="checktr(index)">
							<view :style="{width:tdWidth[0]+'px'}">{{index+1}}</view>
							<view :style="{width:tdWidth[1]+'px'}">
								<radio  :checked="item.ischeck" @click.stop="radiocheck(index)" />
							</view>
							<view :style="{width:tdWidth[2]+'px'}">{{item.BillNo}}</view>
							<view :style="{width:tdWidth[3]+'px'}">{{timesubstr(item.BillTime)}}</view>
							<view :style="{width:tdWidth[4]+'px'}">{{item.stockName}}</view>
							<view :style="{width:tdWidth[5]+'px'}">{{item.stockName2}}</view>
							<view :style="{width:tdWidth[6]+'px'}">{{item.EName}}</view>
							<view :style="{width:tdWidth[7]+'px'}">{{item.Comment}}</view>
							
						</view>
					</view>
				</view>
				<!-- <view style="width: 100%;" v-if="tableList !=''"  v-show="switrs == 1">
					<scroll-view scroll-x>
					<table border="1" class="table_list" >
					  <tr>
					    <th>序号</th>
					    <th>选择</th>
						<th>单号</th>
						<th>日期</th>
						<th>供货单位</th>
						<th>仓库</th>
						<th>业务员</th>
						<th>备注</th>
					  </tr>
					 
					  <tr v-for="(item,index) in tableList" :key="item.id" @click="checktr(index)">
					    <td>{{ index+1 }}</td>
						<td><radio  :checked="item.ischeck" @click.stop="radiocheck(index)" /></td>
						<td>{{ item.BillNo }}</td>
						<td>{{ timesubstr(item.BillTime) }}</td>
						<td>{{ item.BName }}</td>
						<td>{{ item.stockName }}</td>
						<td>{{ item.EName }}</td>
						<td>{{ item.Comment }}</td>
					  </tr>
					
					</table>
						  
				        </scroll-view>
				</view> -->
				<view class="box_list"  style="background-color: #EEEEEE;" v-show="switrs == 2">
					<view v-for="(item,index) in tableList" :key="item.id" @click="checktr(index)"   :class="['item_list',{'item_table':index == homeunfold}] "  >
						<p>单号：{{ item.BillNo }} <span style="position: absolute;right: 10px;top: 5px;">
						<radio  :checked="item.ischeck" @click.stop="radiocheck(index)" /></span></p>
						
						<p>日期：{{timesubstr(item.BillTime)}}</p>
						<p>配出仓库：{{ item.stockName }}</p>
						<p>配入仓库：{{ item.stockName2 }}</p>
						<p>业务员：{{ item.EName }}</p>
						<p>备注：{{ item.Comment }}</p>
						<div class="radius" @click.stop="homeunfolds(index)">
							<!-- <div class="d3" v-if="index != homeunfold"></div>
							<div class="d4" v-else></div> -->
							<span v-if="index != homeunfold">展开</span>
							<span v-else>收起</span>
						</div>
					</view>
				</view>
				<!-- 表格end -->
			</scroll-view>

			<QSpicker title="请选择日期时间" mode="bottom" type="date" ref="QS_Picekr_date" pickerId="date_1" :dataSet="dateSet"
			 showReset :autoHide="false" contentColor="#33cc33" :lineHeight=".05" @hideQSPicker="hideQSPicker($event)"
			 @showQSPicker="showQSPicker($event)" @confirm="confirm($event)" />
			<!-- 弹出框HOME -->
			<view class="cu-modal cu_none " :class="modalName=='Modal'?'show':''">
				<view class="cu-dialog"  >
					<view class="cu-bar bg-white justify-end">
						<view class="content">选择{{listcode}}</view>
						<view class="action" @tap="hideModal">
							<text class="cuIcon-close text-red"></text>
						</view>
					</view>
					<scroll-view style="height: 90%;" scroll-y="true">
						
					<view class="padding-xl" v-show="listshow == 1">
						<view class="search" ><input class="inpt" v-model="selectCli" placeholder="查询配出仓库" name="input"></input>
						<span class="search_span" @click="selectClient()">搜索</span>
						</view>
						<view>
							<view class="btn_list"  v-for="(item,index) in ClientList" 
							 @click="checkuser(index)" :key="item.id">{{item.StoreName}}</view>			
						</view>
					</view>
					
					<view class="padding-xl" v-show="listshow == 2">
						<view class="search" ><input class="inpt" v-model="selectwar" placeholder="查询配入仓库" name="input"></input>
						<span class="search_span"  @click="selectwarehouse()">搜索</span>
						</view>
						<view>
							<view class="btn_list"  v-for="(item,index) in StoreList" 
							 @click="checkware(index)" :key="item.id">{{item.StoreName}}</view>			
						</view>
					</view>
					<view class="padding-xl" v-show="listshow == 3">
						<view class="search" ><input class="inpt" v-model="selectsal" placeholder="查询业务员" name="input"></input>
						<span class="search_span" @click="selectsalesmant()">搜索</span>
						</view>
						<view>
							<view class="btn_list"  v-for="(item,index) in OperatorList" 
							 @click="checksale(index)" :key="item.id">{{item.OperatorName}}</view>			
						</view>
					</view>
					</scroll-view>
				</view>
			</view>
			<!-- 弹出框END -->
			<view class="clickscrolltop" v-show="istop" @click="clicktop">返回</br>顶部</view>
	</view>
	
</template>

<script>
	import allConst from "../../../Json.js"
	import uniIcon from '@/components/uni-icon/uni-icon.vue';
	import QSpicker from '@/components/QuShe-picker/QuShe-picker.vue';
	import * as GetApi from '@/syApis/syHttp/Http.js';
	export default {
		data() {
			return {
				date: '',
				delbillid:[],//存放删除的id
                selectcheckall:1,// 全选
				isshow:false,//弹出框是否显示
				checklist:-1,
				unfold:-1,// 展开
				homeunfold:-1,// 展开
				switrs:2, //主界面风格切换
				// 选中的供应商
				checkedClientList:[],
				//选中的仓库
				checkedwarehouse:[],
				//选中的业务员
				checksalesman:[],
				listshow:-1,//弹出框显示的内容
				listcode:'',//弹出框显示的title
				timeData: {
					clockinfo: '',
					date: '',
					fulldate: '',
					lunar: '',
					month: '',
					range: '',
					year: ''
				},
				timeData1: {
					fulldate: '',
				},
				isdata:0,//判断是开始日期还是结束日期			
				scrollLeft: 0,
				setfixeds:false,//是否固定在顶部
				istop:false,
				modalName: '',
				unitselected: '',
				BillNo:"",
				//单据类型
				BillType:16,
				IsAdd:0,
				BillDate:"",
				//仓库的列表
				StoreList:[],
				//业务员的列表
				OperatorList:[],
				//供应商的列表
				ClientList:[],
				//制单人
				CreateName:uni.getStorageSync("UserName"),
				//税率
				Tax:"",
				//商品列表查看更多标识
				selectLookMore:-1,
				tableList: [],
				dateSet: {
					dateMode: 3,
					dateFormatArray: ['-', '-', ' ', ':', ':']
					},
				// 搜索供应商
				selectCli:'',
				// 搜索的仓库
				selectwar:'',
				// 搜索的业务员
				selectsal:'',
				orderListHeight: 300,
				orderLiHeight: 260,
				orderList: [],
				tdWidth: [50, 60, 125, 125, 125, 125, 125,125],
			}
		},
		computed: {
			tdAllWidth() {
				var tdAllWidth = 0;
				this.tdWidth.forEach(item => {
					tdAllWidth += parseFloat(item);
				});
				tdAllWidth += this.tdWidth.length - 1;
				return tdAllWidth;
			}
		},
		//页面加载完成获取高度
		onReady(){
			var that = this
			uni.getSystemInfo({
			　　success: function(res) { // res - 各种参数
			　	let main = uni.createSelectorQuery().select(".cg-main");
			　　　  　main.boundingClientRect(function(data) { //data - 各种参数
			// 　　　  　console.log("元素的高度"+data.height)  // 获取元素宽度
			        console.log(data)
					 // 剩余的高度
					 // orderListHeight: 300,
					 // orderLiHeight: 260,
					 that.orderListHeight = res.windowHeight - data.height;
					 that.orderLiHeight = (res.windowHeight - data.height) - 40;
					 // that.orderListHeight = res.windowHeight - (6*37);
					 // that.orderLiHeight = (res.windowHeight - (6*37)) - 40;
					 console.log('剩余的高度')
					 console.log(that.orderListHeight)
					 console.log('表格内容的高度')
					 console.log(that.orderLiHeight)
					 // 表格内容的高度
					 console.log((res.windowHeight - data.height) - 40)
			　　    }).exec()
			       }
			});
		},
		components: {
			QSpicker,
			uniIcon,
		},
		onLoad() {
			setTimeout(() => {
				this.showCalendar = true
			}, 350);
			// this.getClientList();
			this.GetOperatorMessage();
			this.GetStoreMessage();
			// this.open(1);
			// this.open(2)
		},
		created(){
			let date = new Date();
			this.BillDate = GetApi.splitdate(date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate());
			//初始化默认赋值今天日期
			this.timeData.fulldate = this.BillDate
			this.timeData1.fulldate = this.BillDate
		},
		onPageScroll(res){
			// console.log(res.scrollTop);//距离页面顶部距离
			var scrolls = res.scrollTop
			var that = this
		    
			uni.getSystemInfo({
			　　success: function(res) { // res - 各种参数
			// 　　   console.log(res); // 屏幕的宽度 
			         // console.log('返回顶部出现的位置'+(res.screenHeight+res.screenHeight/3))
			// 　　    let info = uni.createSelectorQuery().select(".sticky");
			// 　　　  　info.boundingClientRect(function(data) { //data - 各种参数
					 
					 
			// 　　    }).exec()
			that.istop = scrolls>(res.screenHeight+res.screenHeight/2)?true:false
			       }
			});
		},
		methods: {
			//跳转到明细
		checktr:function(e){
				let Detailid =  this.tableList[e]['BillID'];
				let BillNo = this.tableList[e]['BillNo'];
				uni.navigateTo({
				    url: '../../deliveryreturn/delivreturn_select/selectdetail/selectdetail?id='+Detailid+'&BillNo='+BillNo
				});
			},
			//多选
			radiocheck:function(evt){
				// this.ischeck = evt
				this.tableList[evt]["ischeck"] = this.tableList[evt]["ischeck"] == true ? false :true
				// console.log(this.tableList)
				// console.log(evt)
				//如果全部选中了，改变全选
				for(let j in this.tableList){
					if(this.tableList[j]["ischeck"] !=false){
						this.selectcheckall = 2
					}else{
						this.selectcheckall = 1
					}
				}
			},
			// 选择
			electGoods:function(){
				//默认选中第一个
				var check = []
				for(let i in this.tableList){
					// console.log(i)
					// console.log(this.tableList[i]["ischeck"])
					if(this.tableList[i]["ischeck"] == true){
				       check.push(this.tableList[i])
					}
				}
				if(check == "" || check.length == 0){
					GetApi.showTip("请选择单据!");
					return
				}
				var that = this
				if(check.length>=2){
					GetApi.showConfirm("已经选中多张(默认选择第一张单据),是否继续？", function(state,) {
						if (state) {
						   that.returnevent(check[0])
						}
					})
				}else{
					this.returnevent(check[0])
				}
			},
			clicktop:function(){
							 uni.pageScrollTo({
							 scrollTop: 0,
							 duration: 300
							 });
							 console.log('这是一个点击事件')
							 console.log('打印打印')
			},
			returnevent:function(e){
				this.$eventHub.$emit('delireturnfire',e);//携带参数返回
				this.$eventHub.$off('delireturnfire');
				uni.navigateBack({
					delta:1
				})
			},
			//是否展开
			homeunfolds:function(e){
				if(this.homeunfold == e){
					this.homeunfold = -1
				}else{
					this.homeunfold = e
				}
			},
			//全选
			selectcheck:function(){
				// selectcheckall
				for(let j in this.tableList){
					this.tableList[j]["ischeck"] = this.selectcheckall == 1 ? true :false
				}
				this.selectcheckall = this.selectcheckall == 1?2:1
			},
			// 删除
			DelectGoods:function(){
				// 找出选中删除的id
				var delid = null;
				this.delbillid = []
				for(let i in this.tableList){
					if(this.tableList[i]["ischeck"] == true){
						this.delbillid.push(this.tableList[i]["BillID"])
			           // delid+=this.tableList[i]["BillID"]+','
					}
				}
				if(this.delbillid.length == 0 ||this.delbillid==""){
					GetApi.showTip("请选择要删除的单据!");
					return
				}var that = this;
				GetApi.showConfirm("删除单据将无法恢复,是否删除？", function(state,) {
					if (state) {
					
					that.tableList = [] //先清空原来的数据
					let ClientID = uni.getStorageSync("UserCode");
					let CreateName = uni.getStorageSync("UserName");
					let data = {
						BillType:16,
						Database:'FastApp',
						BillID:that.delbillid.join(','),
					};
					GetApi.Delete_Bill(data,function(res){
						  if(res.state){
							  console.log(res)
							   if(res.data.ErrorMsg=="获取登录信息失败"){
								   GetApi.showTip("登录超时");
							   }else if(res.data.ErrorMsg!=""){
								   GetApi.showTip(res.data.ErrorMsg);
							   }else{
								     GetApi.showTip(res.data.TipsMsg);
							   }
						  }else{
							  GetApi.showTip("服务器错误!");
						  }
					});
					}})
			},
			// 选中的配出仓库
			checkuser:function(e){
				this.checkedClientList = this.ClientList[e]
				// this.checklist = e
				this.modalName = null
				console.log('打印的参数')
				console.log(this.checkedClientList)
			},
			// 选中的配入仓库
			checkware:function(e){
				this.checkedwarehouse = this.StoreList[e]
				// this.checklist = e
				this.modalName = null
				console.log('打印的参数')
				console.log(this.checkedwarehouse)
			},
			// 选中的业务员
			checksale:function(e){
				this.checksalesman = this.OperatorList[e]
				// this.checklist = e
				this.modalName = null
				console.log('打印的参数')
				console.log(this.checksalesman)
			},

			//取消
			closemodel:function(){
				this.isshow = false
			},
			//选择配出仓库
			supplier:function(){
				this.isshow = true;
				this.listshow = 1
				this.listcode='配出仓库'
			},
			//选择配入仓库
			warehouse:function(){
				this.isshow = true
				this.listshow = 2
				this.listcode='配入仓库'
			},
			//选择业务员
			salesman:function(){
				this.isshow = true
				this.listshow = 3
				this.listcode='业务员'
			},
			//获取业务员列表
			GetOperatorMessage(){
				let data = {
					Filter:""
				}
				
				var that = this;
				GetApi.GetOperatorMessage(data,function(res){
					  if(res.state){
						   if(res.data.ErrorMsg=="获取登录信息失败"){
							   GetApi.showTip("登录超时");
						   }else if(res.data.ErrorMsg!=""){
							   GetApi.showTip(res.data.ErrorMsg);
						   }else{	  
							   that.OperatorList = res.data.ResultMsg;

						   }
					  }else{
						  
					  }
				});
			},
			//获取仓库
			GetStoreMessage(){
				var that = this;
				let data = {
					Filter:""
				}
				GetApi.GetStoreMessage(data,function(res){
					  if(res.state){
						   if(res.data.ErrorMsg=="获取登录信息失败"){
							   GetApi.showTip("登录超时");
						   }else if(res.data.ErrorMsg!=""){
							   GetApi.showTip(res.data.ErrorMsg);
						   }else{
							   let tmp = res.data.ResultMsg;
							   that.StoreList = tmp;
							   that.ClientList = tmp;
							   
							   
							   // let responseData = res.data.ResultMsg;
							   // that.ClientList  = responseData;
							   console.log('配送的仓库')
							   // console.log(tmp)
							   console.log(that.ClientList)
							   // console.log()
						   }
					  }else{
						  
					  }
				});
			},

			open(name, type) {
				this.isdata = type;//赋值给isdata用于判断是开始日期还是结束日期
				this.$refs[name].show();
				this.dateName = name;
			},
			confirm(res) {
				var data = GetApi.splitdate(res.data);//处理的日期
				console.log(data)
				// 1是开始日期 2是结束日期
				if(this.isdata == 0){
					// console.log(e)
					this.timeData.fulldate = data
				}else if(this.isdata == 1){
					this.timeData1.fulldate = data
				}
				this.$refs[this.dateName].hide();
			},
			showQSPicker(res) {
				console.log(res);
			},
			hideQSPicker(res) {
			
			},
			showModal(e) {
				console.log(1111)
				this.modalName = e.currentTarget.dataset.target
			},
			// 点击后显示弹框
			clickopen:function(evt,msg){
				var that = this;	
				// var evt = e;
				// var msg = m;
				console.log(evt)
				this.listshow = Number(evt);
				that.listcode = msg;
				that.modalName = 'Modal'
			},
			hideModal(e) {
				console.log(222)
				this.modalName = null
			},
			choosesunit(e) {
				console.log(e)
				var unit = e.currentTarget.dataset.unit
				this.unitselected = unit
				this.modalName = null
			},
			//查询
			SelBill(){
				
			    console.log('单据编号')
				console.log(this.BillNo)
			    if(this.timeData.fulldate == "" || this.timeData.fulldate==undefined){
					GetApi.showTip("单据时间不能为空")
				}else if(this.timeData1.fulldate == "" || this.timeData1.fulldate==undefined){
					GetApi.showTip("结束时间不能为空")
				}
				else{
					var that = this;
					that.tableList = [] //先清空原来的数据
					let ClientID = uni.getStorageSync("UserCode");
					let CreateName = uni.getStorageSync("UserName");
					// // 选中的客户
					// checkedClientList:[],
					// //选中的仓库
					// checkedwarehouse:[],
					// //选中的业务员
					// checksalesman:[],
					
					console.log(this.checkedClientList.ClientID)
					let isnullBillNo =  this.BillNo==""?'':  ' and '+"[BillNo] like '%"+this.BillNo+"%'";//如果为空则不传
					let isnullClientID =  this.checkedClientList == "" ||this.checkedClientList ==undefined ?'': ' and '+"StoreID='"+this.checkedClientList.StoreID+"'";
					let isnullEmpID =  this.checksalesman == "" || this.checksalesman ==undefined?'': ' and '+"EmpID='"+this.checksalesman.OperatorID+"'";
					let isnullStoreID =  this.checkedwarehouse == "" ||this.checkedwarehouse==undefined?'': ' and '+"StoreID2='"+this.checkedwarehouse.StoreID+"'";
					let data = {
						BillType:16,
						Database:'FastApp',
						Filter:"[BillTime]>='"+that.timeData.fulldate  +"'●and●[BillTime]<='"+that.timeData1.fulldate+"'"
						+"●and●[state]='0'"+ isnullBillNo+ isnullClientID+isnullEmpID+isnullStoreID,
						
						// +' and '+
						// "ClientID="+this.ClientList[this.index]['ClientID']+  ' and ' + "StoreID="+this.StoreList[this.index2]['StoreID']
						// + ' and ' + "EmpID="+this.OperatorList[this.index1]['OperatorID'] +' and '+ "BillNo="+this.BillNo
						
					};
					GetApi.Select_Bill_Master(data,function(res){
						  if(res.state){
							   if(res.data.ErrorMsg=="获取登录信息失败"){
								   GetApi.showTip("登录超时");
							   }else if(res.data.ErrorMsg!=""){
								   GetApi.showTip(res.data.ErrorMsg);
							   }else if(res.data.TipsMsg == "OK" && res.data.ResultMsg == ""){
								   GetApi.showTip("查无数据");

							   }else{
								     console.log(res.data.ResultMsg);
								   	// that.tableList = res.data.ResultMsg
									for(let i in res.data.ResultMsg){
										console.log(i)
										res.data.ResultMsg[i]["ischeck"] = false;//赋值默认不选中
										console.log(res.data.ResultMsg[i])
									}
									console.log('这是一个打印')
									console.log(res.data.ResultMsg)
									that.tableList = res.data.ResultMsg
							   }
						  }else{
							  GetApi.showTip("服务器错误!");
						  }
					});
				}
			},
			// 主界面切换
			swits:function(){
				this.switrs = this.switrs == 1?2:1
			},
			  //是否全选  点击后改变状态
			ischecka:function(){
						if(this.ischeckall == false){
							this.ischeckall = true
						}else{
							this.ischeckall = false
						}
							
			 },
			 // 日期截取
			 timesubstr:function(e){
				 return e.substring(0,10)
			 },
			 //保留两位小数
			 toFix:function(evt){
				 if(evt == ""|| evt==undefined){
					 return evt
				 }
				 evt = parseFloat(evt);
				 return evt.toFixed(2)//此处2为保留两位小数
			 },
			 onNavigationBarButtonTap(e) {
			 	const index = e.index;
			 	console.log(index);
			 	if (index === 0) {
			        this.swits()
			 		} 
			 },
		}

	}
</script>

<style lang="scss">
	@import url("/delivreturn_select.css");
	page {
		background-color: #EEEEEE;
		padding-bottom: 0upx;
		height: 100%;
	}
	.cu-dialog{
		height: 70%;
	}
	.new-cu-dialog{
		height: 34%;
	}
	.btn_list{
		width: 100%;
		height: 40px;
		background-color: #07C160;
		color: #fff;
		text-align: center;
		line-height: 40px;
		border-radius: 5px;
		box-shadow: 0 2px 8px rgba(211, 209, 209, 0.75);
		margin: 7px 0;
		font-size: 16px;
	}
	.search{
		width: 100%;
		height: 40px;
		margin: 0 10px 0 0;
		/* background-color: #00B7B8; */
		border-radius: 5px;
		border: 1px solid #bcbbbb;
		
	}
	.search_span{
	width: 20%;
	height: 37px;
	background-color: #659AFF;
	color: #FFFFFF;
	text-align: center;
	display: inline-block;
	line-height: 37px;
	float: right;
	border-radius: 5px;
	}
	/* .search::before{
		content: '搜索'; */
	
		/* border-bottom-right-radius: 5px;
		border-top-right-radius: 5px; */
	/* } */
	.search>input{
		line-height: 40px;
		float: left;
		text-align: left;
		margin-left:5px ;
		margin-top: 6px;
	}
	.content{
		font-size: 16px;
	}
	.padding-xl{
		overflow-y: scroll;
	}
	.newbtn_list{
		margin: 0;
		margin-bottom: 15px;
	}
	.cu-form-group{
		min-height: 86upx;
	}
	.cu-form-group>input{
			font-size: 28upx;
		}
	.save{
		width: 100%;
		height: 40px;
		background-color: #007AFF;
		color: #fff;
		position: fixed;
		bottom: 0;
		left: 0;
		text-align: center;
		font-size: 18px;
		line-height: 40px;
	}
	//表格单据
	.orderList {
		width: 100%;
		overflow: auto;
		box-sizing: border-box;
	
		text {
			float: left;
			text-align: center;
			box-sizing: border-box;
			height: 40px;
			line-height: 40px;
			border-right: 1px solid #CCC;
			white-space: nowrap;
			text-overflow: ellipsis;
			overflow: hidden;
	
			&:last-child {
				border: none;
			}
		}
	
		.orderNav {
			height: 40px;
			line-height: 40px;
			box-sizing: border-box;
			overflow: hidden;
			border-top: 1px solid #CCC;
			border-left: 1px solid #FFF;
			background: #FFF;
	
		}
	
		.orderLi {
	
			background: #ebebeb;
			overflow: auto;
	
			.orderItem {
				height: 40px;
				line-height: 40px;
				width: 100%;
				border: 1px solid #ebebeb;
				box-sizing: border-box;
				display: table;
				border-bottom: 1px solid #CCCCCC;
	
				view {
					display: inline-block;
					height: 100%;
					line-height: 35px;
					float: left;
					text-align: center;
					border-right: 1px solid #CCC;
					box-sizing: border-box;
					padding-top: 5upx;
					padding-bottom: 5upx;
					white-space: nowrap;
					text-overflow: ellipsis;
					overflow: hidden;
	
					image {
						width: 60px;
						margin: auto;
						display: table;
					}
	
					&:last-child {
						border: none;
					}
	
				}
			}
		}
	
		.allPrice {
			@extend .orderNav;
			background: rgba(124, 170, 216, 1);
			color: #FFF;
		}
		.background{
			background-color: #fff;
		}
	}
	.statics{
		position: fixed;
		top: 44px;
		left: 0;
		width: 100%;
		z-index: 99;
	}
	.box_list{
		padding: 3px 0;
	}
	.padd{
		padding-top: 41px;
		
		/* padding: 3px 0 ; */
	}
	.clickscrolltop{
		width: 50px;
		height: 50px;
		padding-top: 5px;
		line-height: 20px;
		background: rgba(0, 0, 0, .3);
		border-radius: 25px;
		text-align: center;
		font-size: 12px;
		position: fixed;
		bottom: 20px;
		right: 50px;
		z-index: 999;
		color: #FFF;
	}
</style>
